Image code
In this assignment, you will create an image using RGB values. You will need to use the C++ vector
class to do this. Vectors in C++ are growable arrays with generic types. A vector can only contain one type, which is set using templates when declaring the vector. For example, a vector
can contain ints and a vector
can contain Objects. You can quickly insert at the end of a vector with the push_back()
method. You can access elements with the at()
method. You can get the vector's size with the size()
method. There are many other useful methods, so check an API guide when using vectors.
Check your course repo. You should have a new Image assignment. In this assignment, you will create an RGB image that is saved as a PNG. Be prepared to manipulate C++ classes in the assignment!
In the Image project in your repository, build a 2D image using the ImageBuilder::setup
function and the Colorer
class. You can programmatically control the image in the build by assigning different colorers to different locations. You can also construct the colorers with extra information about their locations and allow the colorer to programmatically color the image.
When you have completed the code that creates your image, commit it to your repository and push to the server.
Rubric
Delegate coloring an image to object instances | 0 : No delegation | 5 : Very simple modification of existing code | 10 : New colorer or builder logic to draw image |